package com.yanqu.road.server.pb;

import com.yanqu.road.entity.activity.ad.AdActivityUserData;
import com.yanqu.road.pb.ad.AdActivityProto;

public class AdActivityPb {
    public static AdActivityProto.AdUserDataMsg.Builder parseAdUserDataMsg(AdActivityUserData data){
        if(null == data){
            return null;
        }
        AdActivityProto.AdUserDataMsg.Builder msg = AdActivityProto.AdUserDataMsg.newBuilder();
        msg.setActivityId(data.getActivityId());
        msg.setDailyWatchTimes(data.getDailyWatchTimes());
        msg.setFirstTotalWatchTimes(data.getFirstTotalWatchTimes());
        msg.setFirstRewardFinish(data.isFirstRewardFinish());
        msg.setSecondTotalWatchTimes(data.getSecondTotalWatchTimes());
        msg.setLastWatchTime(data.getLastWatchTime());
        msg.addAllFirstRewardIndexList(data.getFirstRewardList());
        msg.addAllSecondRewardIndexList(data.getSecondRewardList());
        msg.setGetUnlockReward(data.isGetUnlockReward());
        return msg;
    }
}
